import plugin from '../../../lib/plugins/plugin.js'

export class Coinflipping extends plugin {
  constructor () {
    super({
      name: '[xingchen-plugin] 抛个硬币',
      dsc: '[xingchen-plugin] 抛个硬币',
      event: 'message',
      priority: 1,
      rule: [
        {
          reg: '^#?(抛个硬币|coin)$',
          fnc: 'Coin'
        }
      ]
    })
  }
  
  async Coin (e) {
    let randomid = Math.floor(Math.random()*(3-1))+1;
    if (randomid == 1) {
      var Proscons = "正面"
    } else {
      var Proscons = "反面"
    }
    let msg = `你抛出了一枚硬币...\n...是${Proscons}！`
    e.reply(msg,true)
  return  true
  }
}